<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String money = request.getParameter("money");
String appId = request.getParameter("appid");
String timeStamp = request.getParameter("timeStamp");
String nonceStr = request.getParameter("nonceStr");
String packageValue = request.getParameter("package");
String paySign = request.getParameter("sign");

%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>微信支付</title>
    
	<meta name="viewport" content="width=device-width; initial-scale=1.0"> 
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
		<br><br><br>
  			
		<div style="text-align:center;">
				<h2>北京卓实时代 __ 微信支付 </h2>
				<h3>价格: 0.01元</h3>
		</div>
		<div style="text-align:center;">
			<input type="button" value="确认支付" onclick="callpay()">
		</div>
  </body>
  <script type="text/javascript">
  	function callpay(){
		 WeixinJSBridge.invoke('getBrandWCPayRequest',{
  		 "appId" : "<%=appId%>",
  		 "timeStamp" : "<%=timeStamp%>", 
  		 "nonceStr" : "<%=nonceStr%>",
  		 "package" : "<%=packageValue%>",
  		 "signType" : "MD5", 
  		 "paySign" : "<%=paySign%>" 
   			},function(res){
				WeixinJSBridge.log(res.err_msg);
	            if(res.err_msg == "get_brand_wcpay_request:ok"){  
	                alert("微信支付成功!");
	                
	            }else if(res.err_msg == "get_brand_wcpay_request:cancel"){  
	                alert("用户取消支付!");  
	                
	            }else{  
	               alert("支付失败!");  
	               
	            }  
			})
		}
  </script>
  
</html>
